package com.test.webtest.controller;

import com.test.webtest.entity.AuthorizationCertificate;
import com.test.webtest.service.AuthorizationCertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequestMapping("/certificate")
public class AuthorizationCertificateController {

    @Autowired
    private AuthorizationCertificateService certificateService;

    @PostMapping("/generate")
    public String generateCertificate(@RequestBody AuthorizationCertificate certificate) throws IOException {
        return certificateService.generateCertificate(certificate);
    }
}